<template>
  <div class="employees-container">
    <div class="app-container">
      <el-card>
        <el-tabs>
          <el-tab-pane label="登录账户设置">
            <LoginSetting :userinfo="userinfo" />
          </el-tab-pane>
          <el-tab-pane label="个人详情">
            <UserInfo :userinfo="userinfo" />
          </el-tab-pane>
        </el-tabs>
      </el-card>
    </div>
  </div>
</template>

<script>
import LoginSetting from './components/loginSetting.vue'
import UserInfo from './components/userInfor.vue'
import { getUserDetailById } from '@/api/employees'
export default {
  components: {
    LoginSetting,
    UserInfo
  },
  data () {
    return {
      userinfo: {}
    }
  },
  created () {
    this.getUserDetail()
  },
  methods: {
    async getUserDetail () {
      try {
        const res = await getUserDetailById(this.$route.params.id)
        console.log(res)
        this.userinfo = res
      } catch (error) {
        console.log(error)
      }
    }
  }
}
</script>

